package com.fr.chart.axis;

import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.DataSeriesCondition;
import com.fr.util.Utils;

public class SeriesAttrAlpha
  implements DataSeriesCondition
{
  private static final long serialVersionUID = -4047855499424750103L;
  public static final String XML_TAG = "SeriesAttrAlpha";
  private float alpha = 1.0F;

  public SeriesAttrAlpha()
  {
  }

  public SeriesAttrAlpha(float paramFloat)
  {
    this.alpha = paramFloat;
  }

  public void setAlpha(float paramFloat)
  {
    this.alpha = paramFloat;
  }

  public float getAlpha()
  {
    return this.alpha;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Attr"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("alpha")) != null)
          setAlpha(Utils.string2Number(str2).floatValue());
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("SeriesAttrAlpha");
    paramXMLPrintWriter.startTAG("Attr").attr("alpha", this.alpha).end();
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof SeriesAttrAlpha))
      return false;
    SeriesAttrAlpha localSeriesAttrAlpha = (SeriesAttrAlpha)paramObject;
    return (localSeriesAttrAlpha.alpha == this.alpha);
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("alpha", this.alpha);
    return localJSONObject;
  }

  public String getConditionType()
  {
    return "SeriesAttrAlpha";
  }
}